//
//  ViewController.m
//  蓝牙
//
//  Created by lzy on 2018/4/17.
//  Copyright © 2018年 lzy. All rights reserved.
//

#import "ViewController.h"
#import "ZhongyangViewController.h"
#import "WaiweiViewController.h"
#import "PreviewViewController.h"
#import "CatalogViewController.h"
#import "RootNavigationController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"test";
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton * btn1 = [[UIButton alloc]initWithFrame:CGRectMake(50, 50, 100, 50)];
    [btn1 setBackgroundColor:[UIColor blueColor]];
    [btn1 setTitle:@"外围" forState:UIControlStateNormal];
    [btn1 setTintColor:[UIColor redColor]];
    [btn1 addTarget:self action:@selector(waiwei:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:btn1];
    
    
    UIButton * btn2 = [[UIButton alloc]initWithFrame:CGRectMake(50, 150, 100, 50)];
    [btn2 setBackgroundColor:[UIColor blueColor]];
    [btn2 setTitle:@"中央" forState:UIControlStateNormal];
    [btn2 setTintColor:[UIColor redColor]];
    [btn2 addTarget:self action:@selector(zhongyang:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:btn2];
    
    UIButton * btn3 = [[UIButton alloc]initWithFrame:CGRectMake(50, 250, 200, 50)];
    [btn3 setBackgroundColor:[UIColor blueColor]];
    [btn3 setTitle:@"实时预览画面（xib）" forState:UIControlStateNormal];
    [btn3 setTintColor:[UIColor redColor]];
    [btn3 addTarget:self action:@selector(shishi:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:btn3];
    
    UIButton * btn4 = [[UIButton alloc]initWithFrame:CGRectMake(50, 350, 200, 50)];
    [btn4 setBackgroundColor:[UIColor blueColor]];
    [btn4 setTitle:@"性能优化" forState:UIControlStateNormal];
    [btn4 setTintColor:[UIColor redColor]];
    [btn4 addTarget:self action:@selector(xinneng:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:btn4];
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)xinneng:(UIButton *)btn{
    CatalogViewController *rootController = [[CatalogViewController alloc] initWithStyle:UITableViewStyleGrouped];
    
    [self.navigationController pushViewController:rootController animated:YES];
}
-(void)waiwei:(UIButton *)btn
{
    WaiweiViewController * ctr = [[WaiweiViewController alloc]init];
    [self presentViewController:ctr animated:YES completion:^{
        
    }];
}


-(void)zhongyang:(UIButton *)btn{
    ZhongyangViewController * ctr = [[ZhongyangViewController alloc]init];
    [self presentViewController:ctr animated:YES completion:^{
        
    }];
    
}

-(void)shishi:(UIButton *)btn{
    PreviewViewController * ctr = [[PreviewViewController alloc]init];
    [self presentViewController:ctr animated:YES completion:^{
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
